package com.phb.puhuibao.web.controller;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.idp.pub.service.IBaseService;
import com.idp.pub.web.controller.BaseController;
import com.phb.puhuibao.entity.ProvinceCityArea;

@Controller
@RequestMapping(value = "/provinceCityArea")
public class ProvinceCityAreaController extends BaseController<ProvinceCityArea, String> {
	@Resource(name = "provinceCityAreaService")
	public void setBaseService(IBaseService<ProvinceCityArea, String> baseService) {
		super.setBaseService(baseService);
	}

    /**
     * 
     * @return
     */
	@RequestMapping(value="getArea")
	@ResponseBody
	public Map<String, Object> getArea(@RequestParam String city) {
		Map<String,Object> params = new HashMap<String,Object>();
		params.put("city", city);
		Map<String, Object> data = new HashMap<String, Object>();
		try {
			List<ProvinceCityArea> result = this.getBaseService().findList(params);
			data.put("result", result);
			data.put("message", "查询成功");
			data.put("status", 1);
		} catch (Exception e) {
			data.put("message", "网络异常");
			data.put("status", 0);
		}
		return data;
	}
	
	
}
